<!--  -->
<template>
  <div class="type_openai">
    <el-row>
      <el-col>
        <el-alert
          :title="scriptItem.hint"
          :closable="false"
          style="margin-top: 10px;"
          type="success">
        </el-alert>
      </el-col>
    </el-row>
    <el-row :gutter="12">
      <el-col :span="12">
        <div class="title">{{ scriptItem.eventObj.title }}</div>
        <el-select v-model="dataForm[scriptItem.text].eventSelected" style="width:100%">
          <el-option v-for="(item,index) in scriptItem.eventObj.eventList" :key="index" :label="item" :value="item">
          </el-option>
        </el-select>
      </el-col>
      <el-col :span="12">
        <div class="title">{{ scriptItem.ModelObj.title }}</div>
        <el-select v-model="dataForm[scriptItem.text].modelselected" style="width:100%">
          <el-option v-for="(item,index) in scriptItem.ModelObj.modelList" :key="index" :label="item" :value="item">
          </el-option>
        </el-select>
      </el-col>
    </el-row>
    <el-row>
      <div class="title">{{ scriptItem.PromptObj.title }}</div>
      <TypeTemplate v-if="scriptItem.contentType&&scriptItem.contentType[0]&&scriptItem.contentType[0].type ==='select-template'" style="margin-right: 2px;" v-loading = 'loading'
                      :dataForm='dataForm'
                      :blockInfo='blockInfo'
                      @hiddenSettingModel="hiddenSettingModels"
                      :ispreView='false'
                      :scriptItem='scriptItem.contentType[0]'></TypeTemplate>
    </el-row>
    <el-row :gutter="12">
      <el-col :span="12">
        <div class="title">{{ scriptItem.temperatureObj.title }}</div>
        <el-input-number v-model="dataForm[scriptItem.text].temperatureNum" :min="scriptItem.temperatureObj.mixnum" :max="scriptItem.temperatureObj.maxnum" size="medium" :step="scriptItem.temperatureObj.step"
          style="width:100%"></el-input-number>
        <div class="describe">{{ scriptItem.temperatureObj.hint }}</div>
      </el-col>
      <el-col :span="12">
        <div class="title">{{ scriptItem.maxLengthObj.title }}</div>
        <el-input-number v-model="dataForm[scriptItem.text].maxLengthNum" :min="scriptItem.maxLengthObj.mixnum" :max="scriptItem.maxLengthObj.maxnum" size="medium" :step="scriptItem.maxLengthObj.step"
          style="width:100%"></el-input-number>
        <div class="describe">{{ scriptItem.maxLengthObj.hint }}</div>
      </el-col>
    </el-row>
    <el-row :gutter="12">
      <el-col :span="12">
        <div class="title">{{ scriptItem.topPObj.title }}</div>
        <el-input-number v-model="dataForm[scriptItem.text].topPNum" :min="scriptItem.topPObj.mixnum" :max="scriptItem.topPObj.maxnum" size="medium" :step="scriptItem.topPObj.step"
          style="width:100%"></el-input-number>
        <div class="describe">{{ scriptItem.topPObj.hint }}</div>
      </el-col>
    </el-row>
    <el-row :gutter="12">
      <el-col :span="12">
        <div class="title">{{ scriptItem.frequencyPenaltyObj.title }}</div>
        <el-input-number v-model="dataForm[scriptItem.text].frequencyPenaltyNum" :min="scriptItem.frequencyPenaltyObj.mixnum" :max="scriptItem.frequencyPenaltyObj.maxnum" size="medium" :step="scriptItem.frequencyPenaltyObj.step"
          style="width:100%"></el-input-number>
        <div class="describe">{{ scriptItem.frequencyPenaltyObj.hint }}</div>
      </el-col>
      <el-col :span="12">
        <div class="title">{{ scriptItem.presencePenaltyObj.title }}</div>
        <el-input-number v-model="dataForm[scriptItem.text].presencePenaltyNum" :min="scriptItem.presencePenaltyObj.mixnum" :max="scriptItem.presencePenaltyObj.maxnum" size="medium" :step="scriptItem.presencePenaltyObj.step"
          style="width:100%"></el-input-number>
        <div class="describe">{{ scriptItem.presencePenaltyObj.hint }}</div>
      </el-col>
    </el-row>

  </div>
</template>





<script>
import mixinTypeViewModule from '@/mixins/script-type-view-module'
import TypeTemplate from './type-select-template'


export default {
  props: {
    blockInfo: {
      type: Object,
      default: () => {
      }
    },
    scriptItem: {
      type: Object,
      default: () => { }
    }
  },
  mixins: [mixinTypeViewModule],
  components: { TypeTemplate },
  data () {
    return {


    }
  },
  created () {

  },
  computed: {
    loading () {
      return this.scriptItem.contentType&&this.scriptItem.contentType[0]&&this.scriptItem.contentType[0].type ==='select-template'? false:true
    }
  },
  methods: {
    hiddenSettingModels () {
      this.$emit('hiddenSettingModel')
    }
  }
}
</script>

<style lang="scss" >
.type_openai {
  .title {
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    opacity: 0.9;
  }

  .describe {
    font-size: 12px;
    font-weight: 400;
    color: #000000;
    opacity: 0.45;
  }
}
</style>
